Skip to content

fix(elevenlabs): send the model given to using() for text to speech - #1065

Open
skybleak333 wants to merge 1 commit into
prism-php:mainfrom
skybleak333:fix/elevenlabs-tts-model
Open

skybleak333 wants to merge 1 commit into
prism-php:mainfrom
skybleak333:fix/elevenlabs-tts-model

Conversation

@skybleak333

Copy link
Copy Markdown

Description

ElevenLabs text to speech ignored the model passed to using(). TextToSpeechRequestMapper only sent model_id when it was given as a provider option, so ->using('elevenlabs', 'eleven_flash_v2_5')->asAudio() went out without model_id, and ElevenLabs used its default, eleven_multilingual_v2 (API reference). That's another model, with other latency and price. The OpenAI and Groq speech mappers already send $request->model().

The model from using() is now sent as model_id. A model_id provider option still wins, and using('elevenlabs') without a model still sends none, so ElevenLabs' default applies as before.

New tests: the model from using() is sent (fails without the change), and the provider option overrides it. The full suite, PHPStan, Pint and Rector pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant